package cn.trs.common.enums;

import cn.trs.common.annotation.EnumName;
import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * @version 1.0
 * @author:yuansen
 * @create:2025/3/28 16:27
 * @description:
 * @ClassName: AlgorithmConsumeTypeEnum
 * @company TRS
 */
public enum AlgorithmConsumeTypeEnum {

    Freq(0, "技能频率"),
    Token(1, "技能按token统计"),
    Size(2, "图片分辨率"),
    PARAMETER(3, "按技能字段统计")
    ;

    AlgorithmConsumeTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 消耗类型
     */
    @EnumValue
    private final Integer type;
    /**
     * 消耗描述
     */
    @EnumName
    private final String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static AlgorithmConsumeTypeEnum getByType(Integer type){
        for (AlgorithmConsumeTypeEnum algorithmConsumeTypeEnum: AlgorithmConsumeTypeEnum.values()) {
            if (type.equals(algorithmConsumeTypeEnum.getType())) {
                return algorithmConsumeTypeEnum;
            }
        }
        return null;
    }

}
